package com.sm.service;

import com.sm.dao.ApplyTraditionalMapper;
import com.sm.model.ApplyTraditional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class ApplyTraditionalService {
    @Autowired
    private ApplyTraditionalMapper applyTraditionalMapper;

    public int insert(ApplyTraditional applyTraditional) {
        applyTraditional.setCreateTime(new Date());
        applyTraditional.setStatus(0);
        return applyTraditionalMapper.insert(applyTraditional);
    }

    /**
     * 查询用户待审核申请信息
     * @param userId
     * @param type
     * @return
     */
    public ApplyTraditional selectByUserIdAndType(Integer userId, Integer type) {
        return applyTraditionalMapper.selectByUserIdAndType(userId,type);
    }

}
